import { defineStore } from 'pinia'
export default defineStore('user', {
  state () {
    return {
      username: 'zs',
      age: 18
    }
  },
  actions: {
    test () {
      console.log('actions:test')
    },
    setUsername (str) {
      setTimeout(() => {
        this.username = str
      }, 2000)
    }
  },
  getters: {
    getUserName () {
      return '姓名:' + this.username
    }
  }
})
